home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #2 / Monster Media No. 2 (Monster Media)(1994).ISO / maximus / cdcar202.zip / CDCONVRT.CMD < prev    next >
OS/2 REXX Batch file  |  1994-06-12  |  10KB  |  14 lines

  1. /*                         CD Carousel Door                                */   ;/*                              v 2.02                                     */   ;/*                         by Bill Esposito                                */   ;/*                       The Cereal Port BBS                               */;/*                            1:132/152                                    */;/*                           (603)899-3335                                 */;/*                                                                         */;/*                         Magic name 'CDCAR'                              */;/*                         for latest version                              */;/*                                                                         */;/* *********************************************************************** */;/* DISCLAIMER:  This software is provided "AS IS" without any warranty of  */;/* any kind, either expressed or implied.  USE IT AT YOUR OWN RISK.        */;/*                                                                         */;/* Copyright 1993 by Bill Esposito.  This program is SHAREWARE.    Please  */;/* read the file SHAREWRE.TXT included in this archive.                    */;/* *********************************************************************** */;/*                     *****  CDCONVRT.CMD  *****                           */;/*                                                                         */;/* REXX util to add Size and Date to Files.bbs.  The resultant lists will  */
  2. /* be placed in a subdirectory to the CD Carousel directory (homedir).     */;/* These lists can be large (Simtel20 is 639k) so make sure that you have  */;/* enough free space for all your CD Lists.  The Simtel20 CD took about    */;/* 20 minutes to run as a third task on my 386/40.                         */;/***************************************************************************/;Arg me;'@echo off';config='cdcar.cfg';f=1;do until lines(config)=0;  param.f=linein(config);  f=f+1;end;ok=stream(config,c,'close');parse var param.3 homedir junk;;call RxFuncAdd 'SysloadFuncs','RexxUtil','Sysloadfuncs';call sysloadfuncs;        grn='';        yel=''
  3.         red='';        blu='';        cyan='';        brt='';        gry='';        lo='';redo:;cls;say brt||red'                       CD Carousel Disk Setup Utility';say;say cyan;say 'Enter a name for the CD you wish to install.  This name must conform';say 'to the naming convention for a FAT file.  That means that the filename';say 'must not be longer than 8 characters and not contain spaces, commas,';say 'periods, or backslashes.  'red'DO NOT ADD A FILE EXTENTION.'cyan;say  ;say 'This name will also be used to identify to both yourself and your users';say 'this CD, so it should be simple, descriptive, and use only letters and';say 'numbers.  Example: Simtel20';say
  4. ;say blu'Enter the name for this CD:';call syscurpos 12, 27;pull disk;if length(disk) > 8 then do;  say red'Disk name should be 8 characters or less';  call redo;end  ;say;say cyan'Enter the Drive leter of your CDrom:';say 'example   L';call syscurpos 14, 36;pull cdrom1;;say;say blu'Do the Files.bbs on this disk already contain date/size information? (y,N)';justcopy = translate(sysgetkey())  ;if justcopy <>'Y' then justcopy = 'N';say;say cyan'Do you want to be prompted for each directory found? (y,N)'
  5. incl = translate(sysgetkey());if incl <> 'Y' then incl = 'N';say;sort:;say blu'Do you want the directories to be sorted by Area Name? (Y,n)';sort = translate(sysgetkey());say sort;if sort <> 'N' then sort ='Y';privl:;say cyan'Enter the first letter of the user privilege level required to access this Disk';say cyan'(example: "n" for normal, "p" for privel etc.)';priv = translate(sysgetkey());if priv <> 'S' then if priv <>'A' then if priv <>'C' then if priv <>'E' then if priv <>'F'    then if priv <>'P' then if priv <>'W' then if priv <>'N' then if priv <>'L'    then if priv <>'D' then if priv <>'T' then signal privl;if priv='S' then priv = '10';if priv='A' then priv = '9';if priv='C' then priv = '8';if priv='E' then priv = '7';if priv='F' then priv = '6';if priv='P' then priv = '5';if priv='W' then priv = '4'
  6. if priv='N' then priv = '3';if priv='L' then priv = '2';if priv='D' then priv = '1';if priv='T' then priv = '0';say;keys:;say blu'Enter the numbered key between 1 and 8 if required to access this Disk';say blu'(Enter a percent sign "%" for no key)';key = translate(sysgetkey());if key <>'' then if key > 10 then signal keys;if key <>'' then if key =0 then signal keys;if key =' ' then key = '%';say;cdrom=left(cdrom1,1)':\';rc=sysmkdir(homedir''disk);if rc=206 then say 'An invalid name was used.';if rc=5 then say 'Path already exists';if rc <> 0 then do;   say red'An error occured while trying to create the directory.';   say 'If the Path already exists and you still wish to contine, select 'Y''
  7.    say 'Otherwise please correct the error and try again.'cyan;   cont = translate(sysgetkey());   if cont<>'Y' then exit;end;cls;say;say 'Please wait, scanning the CDROM.....';call sysfiletree cdrom'files.bbs','dirs.' ,'OS';dn=1;total=dirs.0;do i=1 to dirs.0; dirsr=reverse(dirs.i); parse var dirsr bbs'\'names.dn'\'rest; llgnth=length(bbs)+1; llng=length(dirs.i)-llgnth; dirs.i=left(dirs.i,llng); name=reverse(names.dn);          if incl='Y' then do;             say;             say blu'Include 'cyan||dirs.i||blu' in the list of available file areas? (y,n,a)'
  8.              infname = translate(sysgetkey());             if infname<>'Y' then if infname<>'N' then infname = 'Y';             if infname = 'N' then names.dn = 'esposito';          end   ;    if infname <> 'N' then do b = 1 to total ;    if names.b=names.dn then if b <> dn then call rename;   end; if incl='Y' then if left(infname,1)='Y' then call lineout homedir''disk'\names.lst',name dirs.i; if incl='Y' then if left(infname,1)='A' then do;    incl='N';    cls;    say red'Aborting File Area Prompting'blu; end   ; if incl='N' then call lineout homedir''disk'\names.lst',name dirs.i; if infname <> 'N' then call lineout homedir''disk'\names.dup',name ; ok=stream(homedir''disk'\names.lst',c,'close'); ok=stream(homedir''disk'\names.dup',c,'close'); dn=dn+1;end; 
  9. dl='disk.lst';call lineout dl,priv key disk ;'@cd 'homedir''disk ;do until lines('names.lst')=0;  ;   parse value linein('names.lst') with areaname fulldirectory;   bill=fulldirectory'\files.bbs';   ok=stream(areaname'.bbs',c,'open');   say cyan'Processing 'bill||grn '--->' cyan||areaname'.bbs';   ok=stream(bill,c,'open');   if justcopy <>'Y' then do;       do until lines(bill)=0;          filen=linein(bill);          parse var filen filename rest;             if left(filen,1)<>' 'then if left(filen,1)<>'-' then if datatype(left(filen,1),'S') =1 then call size  ;        ok=stream(areaname'.bbs',c,'close');       end;   end;   if justcopy='Y' then do;    ok=stream(bill,c,'close')
  10.     ok=stream(areaname'.bbs',c,'close');       do until lines(bill)=0;          filen=linein(bill);          parse var filen filename szz dtt rest;             if left(filen,1)<>' 'then if left(filen,1)<>'-' then if datatype(left(filen,1),'S') =1 then call jcopy  ;        ok=stream(areaname'.bbs',c,'close');       end;   end;   ok=stream(bill,c,'close');end;sort:;ok=stream(homedir''disk'\names.lst',c,'close') ;if sort='Y' then do;  '@cd' homedir||disk;  '@sort <'homedir||disk'\names.lst >'homedir||disk'\names.tmp';  '@del' homedir||disk'\names.lst >nul';  '@ren names.tmp names.lst >nul';end;ok=stream(homedir||disk||'\dupes.tmp',c,'close');ok=stream(homedir||disk||'\names.dup',c,'close')
  11. '@del' homedir||disk||'\dupes.tmp >nul';'@del' homedir||disk||'\names.dup >nul';if me=1 then do;  homedirr=left(homedir,(length(homedir)-1)) ;  cd homedirr;end;  call cdmenu;exit;size:;rest1=strip(rest);call sysfiletree fulldirectory'\'filename, 'list.','f';   do i=1 to list.0;       lists=list.i;       parse var lists date time size1 ea name;   end;new= left(filename,13)''right(size1,8)''right(date,9)'  'rest1;call lineout homedir''disk'\'areaname'.bbs',new;return;jcopy:;rest1=strip(rest)
  12. call sysfiletree fulldirectory'\'filename, 'list.','f';   do i=1 to list.0;       lists=list.i;       parse var lists date time size1 ea name;   end;new= left(filename,13)''right(szz,8)''right(dtt,9)'  'rest1;call lineout homedir''disk'\'areaname'.bbs',new;return;rename:;say;say  red||name||blu' is a duplicate directory name, please a unique name (8 characters)';say 'to represent 'cyan||dirs.i||blu;pull un;if un='' then signal rename;names.dn=reverse(un);name=reverse(names.dn);ok=stream(homedir||disk'\dupes.tmp',c,'close');do until lines(homedir||disk'\dupes.tmp') = 0;   parse upper value linein(homedir||disk'\dupes.tmp') with check;   parse upper var name cname
  13.  if strip(check) = strip(cname) then say grn'Already used, try again!'blu; if strip(check) = strip(cname) then  signal rename; end;ok=stream(homedir||disk'\dupes.tmp',c,'close');call lineout homedir||disk'\dupes.tmp', cname;ok=stream(homedir||disk'\dupes.tmp',c,'close');do until lines(homedir||disk'\names.dup') = 0;   parse upper value linein(homedir||disk'\names.dup') with check;   parse upper var name cname; if strip(check) = strip(cname) then say grn'Already used, try again!'blu; if strip(check) = strip(cname) then  signal rename;end;ok=stream(homedir||disk'\names.dup',c,'close');b=total;return;;IN.257;IN.258;IN.259;IN.260
  14.